Optimal. Leaf size=80 \[ -\frac {a^2 (A-i B) \tan (e+f x)}{f}-\frac {2 a^2 (B+i A) \log (\cos (e+f x))}{f}+2 a^2 x (A-i B)+\frac {B (a+i a \tan (e+f x))^2}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3527, 3477, 3475} \[ -\frac {a^2 (A-i B) \tan (e+f x)}{f}-\frac {2 a^2 (B+i A) \log (\cos (e+f x))}{f}+2 a^2 x (A-i B)+\frac {B (a+i a \tan (e+f x))^2}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3477
Rule 3527
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) \, dx &=\frac {B (a+i a \tan (e+f x))^2}{2 f}-(-A+i B) \int (a+i a \tan (e+f x))^2 \, dx\\ &=2 a^2 (A-i B) x-\frac {a^2 (A-i B) \tan (e+f x)}{f}+\frac {B (a+i a \tan (e+f x))^2}{2 f}+\left (2 a^2 (i A+B)\right ) \int \tan (e+f x) \, dx\\ &=2 a^2 (A-i B) x-\frac {2 a^2 (i A+B) \log (\cos (e+f x))}{f}-\frac {a^2 (A-i B) \tan (e+f x)}{f}+\frac {B (a+i a \tan (e+f x))^2}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 2.40, size = 263, normalized size = 3.29 \[ \frac {a^2 \sec (e) \sec ^2(e+f x) (\cos (2 f x)+i \sin (2 f x)) \left (-8 (A-i B) \cos (e) \cos ^2(e+f x) \tan ^{-1}(\tan (3 e+f x))-i \left ((B+i A) \cos (e+2 f x) \left (4 f x-i \log \left (\cos ^2(e+f x)\right )\right )+2 \cos (e) \left ((A-i B) \log \left (\cos ^2(e+f x)\right )+4 i A f x+4 B f x-i B\right )-2 i A \sin (e+2 f x)+4 i A f x \cos (3 e+2 f x)+A \cos (3 e+2 f x) \log \left (\cos ^2(e+f x)\right )+2 i A \sin (e)-4 B \sin (e+2 f x)+4 B f x \cos (3 e+2 f x)-i B \cos (3 e+2 f x) \log \left (\cos ^2(e+f x)\right )+4 B \sin (e)\right )\right )}{4 f (\cos (f x)+i \sin (f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 125, normalized size = 1.56 \[ \frac {{\left (-2 i \, A - 6 \, B\right )} a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-2 i \, A - 4 \, B\right )} a^{2} + {\left ({\left (-2 i \, A - 2 \, B\right )} a^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-4 i \, A - 4 \, B\right )} a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-2 i \, A - 2 \, B\right )} a^{2}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.19, size = 229, normalized size = 2.86 \[ \frac {-2 i \, A a^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, B a^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 i \, A a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 \, B a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 i \, A a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, B a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, A a^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, B a^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 i \, A a^{2} - 4 \, B a^{2}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 123, normalized size = 1.54 \[ -\frac {a^{2} B \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {a^{2} A \tan \left (f x +e \right )}{f}+\frac {2 i a^{2} B \tan \left (f x +e \right )}{f}+\frac {i a^{2} A \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}+\frac {a^{2} B \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}-\frac {2 i a^{2} B \arctan \left (\tan \left (f x +e \right )\right )}{f}+\frac {2 a^{2} A \arctan \left (\tan \left (f x +e \right )\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.73, size = 71, normalized size = 0.89 \[ -\frac {B a^{2} \tan \left (f x + e\right )^{2} - 4 \, {\left (f x + e\right )} {\left (A - i \, B\right )} a^{2} - 2 \, {\left (i \, A + B\right )} a^{2} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \, {\left (A - 2 i \, B\right )} a^{2} \tan \left (f x + e\right )}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.54, size = 76, normalized size = 0.95 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (2\,B\,a^2+A\,a^2\,2{}\mathrm {i}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+B\,a^2\,1{}\mathrm {i}\right )}{f}-\frac {B\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.60, size = 128, normalized size = 1.60 \[ - \frac {2 i a^{2} \left (A - i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 2 A a^{2} + 4 i B a^{2} + \left (- 2 A a^{2} e^{2 i e} + 6 i B a^{2} e^{2 i e}\right ) e^{2 i f x}}{- i f e^{4 i e} e^{4 i f x} - 2 i f e^{2 i e} e^{2 i f x} - i f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________